package com.zhenhao.xsq.ui.activity.user.module;


import com.zhenhao.xsq.data.api.HttpAPIWrapper;
import com.zhenhao.xsq.ui.activity.base.ActivityScope;
import com.zhenhao.xsq.ui.activity.user.UserAddActivity;
import com.zhenhao.xsq.ui.activity.user.contract.UserAddContract;
import com.zhenhao.xsq.ui.activity.user.presenter.UserAddPresenter;

import dagger.Module;
import dagger.Provides;

/**
 * @author xlei
 * @Package com.yxld.gb.xsq.ui.activity.user
 * @Description: The moduele of UserAddActivity, provide field for UserAddActivity
 * @date 2019/03/15 13:40:16
 */
@Module
public class UserAddModule {
    private final UserAddContract.View mView;


    public UserAddModule(UserAddContract.View view) {
        this.mView = view;
    }

    @Provides
    @ActivityScope
    public UserAddPresenter provideUserAddPresenter(HttpAPIWrapper httpAPIWrapper, UserAddActivity mActivity) {
        return new UserAddPresenter(httpAPIWrapper, mView, mActivity);
    }

    @Provides
    @ActivityScope
    public UserAddActivity provideUserAddActivity() {
        return (UserAddActivity) mView;
    }
}